package yealink;

/**
 * Created by lizhenyu on 2019/9/18
 * description
 */

public class Test extends B{
    private C c = new C();   //先执行实例化

    // 再执行构造函数
    Test() {
        System.out.println("Hello worLd");
    }

    public static void main(String[] args) {
        // new Test();
        new B();
    }

}

class A{
    private int a = 3;
    A(int a) {
        System.out.println("yealink.A Create");
    }
    public void show(){
        System.out.println(a);
    }
}

class B extends A{
    B() {
        super(2);   // 调用父类有参构造
        System.out.println("yealink.B Create");
        show();
    }
}

class C{
    C() {
        System.out.println("yealink.C Create");
    }
}